//
//  ViewController.m
//  GBStarRateView
//
//  Created by 蓓蕾 on 2021/8/9.
//

#import "ViewController.h"
#import "GBStarRateView.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    GBStarRateView *rateHalfView = [[GBStarRateView alloc] initWithFrame:CGRectMake(20, 100, 34 * 4 + 24, 24) style:GBStarRateViewStyleHalfStar numberOfStars:5 isAnimation:YES finish:^(GBStarRateView *starRateView, CGFloat starRate) {
        NSLog(@"评分：%lf",starRate);
    }];
    rateHalfView.currentStarRate = 3.5;
    [self.view addSubview:rateHalfView];
    
    
    GBStarRateView *rateWholeView = [[GBStarRateView alloc] initWithFrame:CGRectMake(20, 200, 34 * 4 + 24, 24) style:GBStarRateViewStyleWholeStar numberOfStars:5 isAnimation:YES finish:^(GBStarRateView *starRateView, CGFloat starRate) {
        NSLog(@"评分：%lf",starRate);
    }];
    rateWholeView.currentStarRate = 4.0;
    [self.view addSubview:rateWholeView];
}


@end
